<template>
  <div>
    <NavBar></NavBar>
    <div class="w">
      <div class="menu-title"><i class="el-icon-position">地产详情</i></div>
      <div class="body">
        <br />
        <div class="headline">
          <a href=""
            ><h1>{{ list.desc }}</h1></a
          >
        </div>
        <div class="picture">
          <div class="left">
            <img :src="list.image" alt="" />
          </div>
          <div class="right">
            <div class="head">
              <div class="head_item">
                <img :src="list.photos ? list.photos[0] : ''" alt="" />
              </div>
              <div class="head_item">
                <img :src="list.photos ? list.photos[1] : ''" alt="" />
              </div>
            </div>
            <div class="price">{{ list.price }}元</div>
            <div class="bottom">
              <MAP></MAP>
            </div>
          </div>
        </div>
        <div>
          <h2 v-html="list.content"></h2>
          <h2></h2>
        </div>
      </div>
    </div>
    <Footer></Footer>
  </div>
</template>
<script>
//引入接口
import MAP from "@/components/MapContainer";
import { house } from "@/api/estate";
export default {
  components: {
    MAP,
  },
  data() {
    return {
      // id:this.$route.query.id, //指定id
      list: [],
      src: "https://img1.baidu.com/it/u=673790231,3028589035&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",
    };
  },
  async created() {
    console.log(36, this.$route.query.id);
    this.list = await house(this.$route.query.id);
    console.log(37, this.list);
  },
};
</script>

<style lang="less" scoped>
.w {
  width: 1000px;
  margin: 0 auto;
}
.menu-title {
  // line-height: 700;
  font-size: 20px;
  // background-color: #fff;
  padding: 15px 0;
  font-size: 20px;
  color: orange;
}
.body {
  height: 600px;
  border: 2px solid #cccccc6c;
  margin-bottom: 10px;
  .headline {
    font-weight: bold;
    line-height: 30px;
    font-size: 20px;
  }
  .picture {
    height: 60%;
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    border-bottom: 1px solid #cccccc6c;
  }
  .left {
    width: 60%;
    // background-color: #6cf;
    margin-bottom: 5px;
    overflow: hidden;
  }
  .left img {
    width: 100%;
    object-fit: cover;
  }
  .right {
    width: 38%;
    margin-right: 15px;
    margin-bottom: 5px;
    .bottom {
      height: 135px;
    }
    .head {
      height: 50%;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-around;
    }
    .head .head_item {
      width: 48%;
      height: 150px;
      background-color: pink;
      border: 1px solid #000;
      overflow: hidden;
    }
    .head .head_item img {
      width: 100%;
      height: 100%;
      //  object-fit: cover;
    }
  }
  .price {
    text-align: center;
    font-size: 18px;
    color: #f2a72e;
  }
}
</style>